#include "widget.h"
#include "ui_widget.h"
#include <QJsonDocument>
#include <QJsonParseError>
#include <QDebug>
#include <QFileDialog>
#include <QFileInfo>
#include <QFile>
#include <QMessageBox>
//#include <QScriptEngine>
//#include <QScriptValue>
//#include <QScriptValueIterator>
#include <QJsonDocument>
#include <QJsonParseError>
#include <QJsonObject>
#include <QJsonArray>


Widget::Widget(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::Widget)
{
     ui->setupUi(this);

     API_id = "25363030";
     API_key = "U3G8WYn6XyCo8oWUvG3SuWQA";
     API_access_token="";
     API_language="zh";
     API_secret_key = "Yjo6Qcau6r2V7kMwLmgYimAG9SIoAVRo";
     API_record_path="C:/Users/Administrator/Desktop/UBTV4.m4a";
}

Widget::~Widget()
{
    delete ui;
}

void Widget::on_pushButton_shortSound2Txt_clicked()
{
    m_shortSound.getAccessToken(API_key,API_secret_key);
    m_shortSound.getResult(API_record_path);
}

void Widget::on_pushButton_loadFile_clicked()
{
//    API_record_path = QFileDialog::getOpenFileName(this,"","","*");
//    qDebug() << API_record_path;
    m_shortSound.getAccessToken(API_key,API_secret_key);
}

void Widget::on_pushButton_batchSound2Txt_clicked()
{
    m_batchSound.getAccessToken(API_key,API_secret_key);
    m_batchSound.createTask();
}
